<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <rich:panel>
        <f:facet name="header">#{messages['application.curso.label']}</f:facet>

		<s:decorate id="campus" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.campus.label']}</ui:define>
            #{cursoHome.instance.campus.desCampus}
        </s:decorate>

        <s:decorate id="nomCurso" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.curso.label.nome']}</ui:define>
            #{cursoHome.instance.nomCurso}
        </s:decorate>

        <s:decorate id="desCurso" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.curso.label.descricao']}</ui:define>
            #{cursoHome.instance.desCurso}
        </s:decorate>

        <s:decorate id="numDuracao" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.curso.label.duracao']}</ui:define>
            #{cursoHome.instance.numDuracao}
        </s:decorate>

        <s:decorate id="indTipoDuracao" template="layout/display.xhtml">
            <ui:define name="label">#{messages['application.curso.label.tipoduracao']}</ui:define>
            #{cursoHome.instance.indTipoDuracao.label}
        </s:decorate>

        <div style="clear:both"/>
        
    </rich:panel>
    
    <div class="actionButtons">      

        <s:button view="/CursoEdit.xhtml" 
                    id="edit" 
                 value="#{messages['application.label.edit']}"/>

        <s:button view="/#{empty cursoFrom ? 'CursoList' : cursoFrom}.xhtml"
                    id="done"
                 value="#{messages['application.label.done']}"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab label="#{messages['application.gradecurricular.label']}">
    <div class="association" id="gradeCurricularsChildren">
        
        <h:outputText value="#{messages['application.curso.label.gradecurricular.empty']}" 
                   rendered="#{empty cursoHome.gradeCurriculars}"/>
        
        <rich:dataTable value="#{cursoHome.gradeCurriculars}" 
                       var="gradeCurricular" 
                  rendered="#{not empty cursoHome.gradeCurriculars}" 
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="gradeCurricularsTable">
            <h:column>
                <f:facet name="header">#{messages['application.gradecurricular.label.ano']}</f:facet>
                #{gradeCurricular.numAno}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['application.gradecurricular.label.semestre']}</f:facet>
                #{gradeCurricular.numSemestre}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['application.gradecurricular.label.periodovigente']}</f:facet>
                #{gradeCurricular.numPeriodoVigente}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['application.label.action']}</f:facet>
                <s:link id="selectgradeCurricular" 
                     value="#{messages['application.label.select']}" 
                      view="/GradeCurricular.xhtml">
                    <f:param name="gradeCurricularIdtGradeCurricular" 
                            value="#{gradeCurricular.idtGradeCurricular}"/>
                    <f:param name="gradeCurricularNumAno" 
                            value="#{gradeCurricular.numAno}"/>
                    <f:param name="gradeCurricularNumSemestre" 
                            value="#{gradeCurricular.numSemestre}"/>
                    <f:param name="gradeCurricularNumPeriodoVigente" 
                            value="#{gradeCurricular.numPeriodoVigente}"/>
                    <f:param name="gradeCurricularFrom" value="Curso"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    
    <div class="actionButtons">
        <s:button 
               value="#{messages['application.curso.label.addgradecurricular']}"
                view="/GradeCurricularEdit.xhtml">
            <f:param name="cursoIdtCurso" 
                    value="#{cursoHome.instance.idtCurso}"/>
            <f:param name="gradeCurricularFrom" value="Curso"/>
        </s:button>
    </div>        
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
